<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="STYLESHEET" href="print_static.css" type="text/css" />
<style type="text/css">
body{
	padding: 0.4in 1in 0.3in 1.5in;
	font-size:14px;
}
table { border-collapse: collapse; width: 100%; }
td {text-align: center; }
h1 {font-size:145%; text-align:center; font-weight:normal;}

.logo { width: 30%; float:left; font-size:7; font-weight:bold; text-align:center}
.logo table {width: 100%;}
.logo td {border: 0; }
.tabla thead {border:0; height: 30px;}
.tabla td {border: 0.5pt solid black;}
.materia {text-align: justify;}
.foot { width: 100%;}
.espacio {height:50px;}

div.salto{
	height:1px; width:100%;
	page-break-after: always
}
</style>

</head>

<body>
<script type="text/php">
$header=$pdf->open_object();
$font = Font_Metrics::get_font("Sans-serif", "normal");
$texto = "www.termaule.cl";
$hpagina = $pdf->get_height();
$wpagina = $pdf->get_width();
$wtexto = Font_Metrics::get_text_width($texto, $font, 12);
$pdf->image("system/application/views/mod_estadoDiario/sello.png", "png", 80, 20, 60, 60);
$pdf->close_object();
$pdf->add_object($header, "all");
</script>
<?php 
$cantidad = $results -> num_rows;
if($cantidad <= 8)
	$iter = 1;
if($cantidad > 8 AND $cantidad <= 16)
	$iter = 2;
if($cantidad > 16 AND $cantidad <= 24)
	$iter = 3;
$j = 0;
for ($i = 1 ; $i <= $iter ; $i++):
?>
<div class="logo">
<table>
		<tr>
			<!-- td rowspan="3"><img style="width: 25%;" src="<?php echo base_url();?>system/application/views/mod_estadoDiario/sello.png"/></td-->
			<td>TRIBUNAL ELECTORAL REGIONAL</td>
		</tr>
		<tr>
			<td>REGIÓN DEL MAULE</td>
		</tr>
		<tr>
			<td>TALCA</td>
		</tr>
</table>
</div>
<h1>ESTADO CONFORME ART.50 DEL CODIGO DE PROCEDIMIENTO CIVIL Y ART.27 DE LA LEY 18.593</h1>
<p align="right">
<?php
	//$date = date('Y-m-d');
	echo "Talca, ".$this->my_library->dayMonthYear($fecha).".-"; 
?></p>
<div class="tabla">
<table style='border:none'>
	<thead>
	<tr>
		<th width="11%">N&ordm; De Orden</th>
		<th width="14%">N&ordm; del Expediente</th><th width="16%">N&ordm; Orden (en letras)</th>
		<th width="42%">Apellidos Reclamantes-Apellidos Reclamados</th>
		<th>Resoluciones Dictadas</th>
	</tr>
	</thead>
	<tbody>
<?php
	$search = array("<br />","\n");
	while ($j < $cantidad)
	{
		
		
		$row = $results ->row($j);
		$materia = str_replace ($search  ,'', $row->materia );
		if($row->sentencia == 'Si')
			$s = 'Sentencia<br />';
		else
			$s = '';
			
		echo "<tr><td>".($j+1)."</td>";
		echo "<td>".$row->rol_causa."</td>";
		echo "<td>".$this->my_library->getNumeroOrden(($j+1))."</td>";
		echo "<td style='padding:0 3px ; text-align:left; text-transform:uppercase'>".wordwrap($materia,  40, "<br />\n")."</td>";
		echo "<td>".$s."".$row->resoluciones."</td></tr>";
		if(($j+1) == 8 || ($j+1) == 16 || ($j+1) == 24)
		{ 
			break;
		}
		$j=$j+1;
	}
	$j=$j+1;
	?>
	</tbody>
</table>
</div>
<div class="espacio"></div>
<div>
	<table>
		<tr>
			<td width="50%" style="padding:0 60px 0 0">Certifico que se ha(n) notificado _______________ resolución(es)</td>
			<td width="50%"></td>
		</tr>
		<tr>
			<td style="padding:0 60px 0 0">Siendo la última ______________________________________</td>
			<td style="padding:0 0 0 60px">_____________________________________________</td>
		</tr>
		<tr>
			<td style="padding:0 60px 0 0">_____________________________________________________</td>
			<td style="text-align:center; padding:0 0 0 60px">SECRETARIO RELATOR</td>
		</tr>
	</table>
</div>
<div class="salto"></div>
<?php endfor;?>
</body>
</html>